﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.BIP;
using yunbo.Repositorys.BIPRepositorys;
using yunbo.Repositorys.FPMRepositorys;

namespace yunbo.Controllers.BIPControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BGController : ControllerBase
    {
        BGRepository bgRepository = new BGRepository();
        [HttpPost("PostBG")]
        public IActionResult PostBG(BG bg)
        {
            bool rs= bgRepository.PostBG(bg)>0;
            return Ok(rs);
        }
        [HttpGet("GetBG")]
        public IActionResult GetBG(string code)
        {
            List<BG> bgs= bgRepository.GetBG(code);
            return Ok(bgs);
        }
    }
}
